package com.ddn.controller.person;

import com.ddn.model.personnel.Exam;
import com.ddn.service.personnel.ExamService;
import com.ddn.util.ResultData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

/**
 * @author Bikakaso
 * @date 2023/1/1
 * ddn_hotel
 */

@RestController
@RequestMapping("/exam")
public class ExamController {
    @Autowired
    private ExamService examService;

    // 查询全部 && 模糊查询
    @RequestMapping("/list")
    public ResultData findAll(@RequestParam HashMap<String,Object> map) {
        ResultData data = examService.findAll(map);
        return data;
    }

    @RequestMapping("/add")
    public ResultData add(@RequestParam HashMap<String,Object> map) {
        System.out.println("map = " + map);
        ResultData data = examService.add(map);
        return data;
    }

    @RequestMapping("/delete")
    public ResultData deleteById(int id) {
        ResultData data = examService.deleteById(id);
        return data;
    }
    @RequestMapping("/deleteBatch")
    public ResultData deleteBatch(int[] ids) {
        ResultData data = examService.deleteBatch(ids);
        return data;
    }
    @RequestMapping("/edit")
    public ResultData edit(@RequestParam HashMap<String,Object> map) {
        ResultData data = examService.edit(map);
        return data;
    }
}
